<template>
    <view class="page">
        <navHead :datas="headData"></navHead>
        <view class="head ">
            <image class="userImg" :src="dataInfo.img">
            </image>
        </view>
        <view class="content  pd-30">
            <view class="text bd-r40 pd-20 fw-800 ft-28">

                <h2>规则说明</h2>
                <view class="fw-400 c-66 ft-24 mt-10">
                    <view v-html="dataInfo.html"></view>

                </view>
            </view>
            <view class="btn">确定</view>
        </view>

    </view>


</template>
<script setup lang="js">
import { ref, reactive, onMounted, nextTick } from "vue";
import { utils } from "@/utils/utils.js";
import { api } from "@/utils/api.js";
import navHead from '@/components/navHead.vue';
import { onLoad } from "@dcloudio/uni-app";
const headData = reactive({
    color: '#fff',
    title: '规则说明'
})
const dataInfo = ref({})
const list = ref([
    { id: 1, name: '资质公示', html: '', img: 'https://cdn.oss.bon-top.cn/static_bc/images/zzgs.png' },
    { id: 2, name: '用户协议', html: '', img: 'https://cdn.oss.bon-top.cn/static_bc/images/yhxy.png' },
    { id: 3, name: '隐私权政策', html: '', img: 'https://cdn.oss.bon-top.cn/static_bc/images/ysqzc.png' },
    { id: 4, name: '会员服务协议', html: '', img: 'https://cdn.oss.bon-top.cn/static_bc/images/hyfwxy.png' },
    { id: 5, name: '关于白菜出国', html: '', img: 'https://cdn.oss.bon-top.cn/static_bc/images/gybccg.png' },
])
onMounted(() => {
    // getShareReduceListFun()

})


// 返回键
const goBack = () => {
    uni.navigateBack(-1)
}
//获取分享减免规则
const getShareReduceListFun = () => {

    utils
        .request(
            api.getShareReduceList,
            {
                page: 1,
                pageSize: 10,
                type: activsub.value,
                app_id: utils.app_id,
                identity: utils.identity,
            },
            "get"
        )
        .then((res) => {
            // benefitShareList.value = res.data.items;
            console.log(res, "res>>>>>>>>>>>");

        });
};
onLoad((option) => {
    if (!option.data) {
        console.log('hhhh', option.name)
        let find = list.value.find(f => option.name == f.name)
        console.log('find', find)
        dataInfo.value = find
    } else {
        dataInfo.value = JSON.parse(option.data)

    }
})


</script>

<style lang="scss" scoped>
.page {
    border-top: 2rpx solid #F1F1F1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.head {
    width: 100%;
    padding: 30rpx 0;
    text-align: center;

    .userImg {
        width: 690rpx;
        height: 332rpx;
    }
}

.content {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;

    .text {
        width: 690rpx;
        min-height: 770rpx;

        margin: 30rpx auto;
        background-color: #F8F8F8;

    }

    .btn {
        background-color: #333;
        color: #fff;
        text-align: center;
        width: 688rpx;
        height: 78rpx;
        line-height: 78rpx;
        border-radius: 20rpx;
        font-size: 28rpx;
        margin-bottom: auto;
    }
}
</style>